<template>
  <div class="not-found">
    <img src="@/assets/logo.png" />
    <div class="not-code">404</div>
    <div class="not-tips">页面未找到，请检查地址是否正确...</div>
    <div class="mt100">
      <el-button type="primary" @click="handleBack">返回上一页</el-button>
      <el-button @click="handleHome">返回首页</el-button>
    </div>
  </div>
</template>
<script setup lang="ts">
const { proxy } = getCurrentInstance() as any;
const router = useRouter();

// 返回首页
const handleHome = () => {
  if (proxy.isMobile) {
    router.replace({ path: "/m/index" });
  } else {
    router.replace({ path: "/pc/index" });
  }
};

// 返回上一页
const handleBack = () => {
  router.go(-1);
};
</script>
<style lang="scss" scoped>
.not-found {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  img {
    width: 100px;
    height: 100px;
  }
  .not-code {
    font-size: 90px;
    font-weight: bold;
    color: #999;
  }
  .not-tips {
    font-size: 20px;
    color: #999;
  }
}
</style>
